gl: Store the legacy bit in the GL program data
authorEmmanuele Bassi <ebassi@gnome.org>
Tue, 6 Oct 2015 18:55:07 +0000 (19:55 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Wed, 7 Oct 2015 15:21:57 +0000 (16:21 +0100)
We need to know if we're using a legacy GL context in various places.

https://bugzilla.gnome.org/show_bug.cgi?id=756142

gdk/gdkglcontext.c
gdk/gdkglcontextprivate.h

index 874f1adf07ac69b0101cd29ee14c0d592905708a..d7420e9b3f183b1e5f52c88bc8ce15f4ff83721f 100644 (file)
@@ -345,7 +345,10 @@ gdk_gl_context_get_paint_data (GdkGLContext *context)
   GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
 
   if (priv->paint_data == NULL)
-    priv->paint_data = g_new0 (GdkGLContextPaintData, 1);
+    {
+      priv->paint_data = g_new0 (GdkGLContextPaintData, 1);
+      priv->paint_data->is_legacy = priv->is_legacy;
+    }
 
   return priv->paint_data;
 }
index a4f19d649e10c920d92285b69ab3f2983b25e1f1..348c16824df6b87ab55c3b508dd4e61108c5208b 100644 (file)
@@ -67,6 +67,8 @@ typedef struct {
   GdkGLContextProgram texture_rect_quad_program;
 
   GdkGLContextProgram *current_program;
+
+  guint is_legacy : 1;
 } GdkGLContextPaintData;
 
 void                    gdk_gl_context_set_is_legacy            (GdkGLContext    *context,